using Dapper.Contrib.Extensions;
using Publicuse.Entity.AttributeUtil;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Publicuse.Entity
{
    /// <summary>
    /// 消息通知管理
    /// </summary>
    [DBTable("`geeker-noticean`", "消息通知管理")]
    [Table("`geeker-noticean`")]
    [SugarTable("`geeker-noticean`")]
    public class Noticean : BaseModel<long>
    {
        [Remark("标题")]

        public string title { get; set; }

        [Remark("类型")]

        public string type { get; set; }

        [Remark("内容")]

        public string content { get; set; }

        [Remark("已读用户")]

        public string readornot { get; set; }

        [NoQuery]
        [SugarColumn(IsIgnore = true)]
        public string readornotb { get; set; }

        [Remark("发布人")]

        public string publisher { get; set; }

        [Remark("时间信息")]
        [NoInsert]
        [NoQuery]
        [SugarColumn(IsIgnore = true)]
        public string infotime { get; set; }

        public Noticean()
        {
            this.Id = 0;
        }
    }

    /// <summary>
    /// 消息通知信息查询参数
    /// </summary>
    public class NoticeanQuery : CommonQuery
    {

        public NoticeanQuery()
        {
            this.exportName = GetExportName;
            this.businessType = BusinessType.noticean;
        }

        public static string GetExportName
        {
            get { return "noticean"; }
        }
    }

    public class NoticeanDetail 
    {
        /// <summary>
        /// 全部消息通知
        /// </summary>
        public List<Noticean> alldata { get; set; } = new List<Noticean>();

        /// <summary>
        /// 未读消息通知
        /// </summary>
        public List<Noticean> unreaddata { get; set; } = new List<Noticean>();

        /// <summary>
        /// 已读消息通知
        /// </summary>
        public List<Noticean> readdata { get; set; } = new List<Noticean>();
    }
}
